<?php

namespace App\Library\Requests\Plug;

use App\Library\Requests\Base\BasePageRequest;
use App\Models\SystemConfigModel;
use Illuminate\Support\Arr;

class PlugPageRequest extends BasePageRequest
{
    public function rules(): array
    {$content = SystemConfigModel::query()->where('id',1)->value('content');
        $classList = Arr::get($content, 'jlTag');
        //$classList = array_column($classList,'contet');
       $classList = array_keys($classList);

        return array_merge(parent::rules(), [
            'plug' => 'nullable|integer|in:' . implode(',',$classList),
            'keyword' => 'nullable|string|max:20',
            'version' => 'nullable|integer|in:2',
        ]);
    }
}
